package com.krui.iweibo.service.imageprocess;

import android.graphics.Bitmap;
import android.widget.ImageView;

import com.krui.iweibo.app.IweiboApplication;

public class SimpleImageLoader {

	public static void showImg(ImageView imageView,String url){
		
		imageView.setTag(url);
		imageView.setImageBitmap(IweiboApplication.asyncImageLoader.getImage(url, getCallback(url, imageView)));
	}
	
	
	private static ImageLoaderCallback getCallback(final String url,final ImageView view){
		
		return new ImageLoaderCallback() {
			
			@Override
			public void onFinish(String url, Bitmap bitmap) {
				if (url.equals(view.getTag().toString())) {
					view.setImageBitmap(bitmap);
				}
			}
		};
	}
	
	
	
	
	
	
}
